import 'package:auto_route/auto_route.dart';
import 'package:tender_flutter/manager/permission_manager.dart';

/// 查看信息权益
class CheckPermissGurad extends RouteGuard {
  @override
  Future<bool> canNavigate(ExtendedNavigatorState navigator, String routeName,
      Object arguments) async {
    // UserInfoEntity infoEntity = SPUtils.getUserInfo();
    // if (infoEntity.isVip()) {
    //   // 非VIP
    //   var result =
    //       await showFreePermissDialog(MyApp.navigatorState.currentContext);
    //   if (result == AppConstant.DIALOG_ACTION_CANCEL) {
    //     return false;
    //   } else {
    //     return true;
    //   }
    // }

    return PermissionManager.canCheck();
  }

  // /// 权益弹窗
  // Future showFreePermissDialog(BuildContext context) async {
  //   return showAnimationDialog(
  //       context: context,
  //       transitionType: TransitionType.inFromTop,
  //       builder: (context) {
  //         return FreePermissionDialog();
  //       });
  // }
}
